local sk__chengfeng = fk.CreateSkill {

  name = "sk__chengfeng",

  tags = { Skill.Compulsory, },

}



sk__chengfeng:addEffect(fk.DamageInflicted, {
  name = "sk__chengfeng",
  anim_type = "special",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk__chengfeng.name)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local judge = {
      who = player,
      reason = sk__chengfeng.name,
      pattern = ".",
    }
    room:judge(judge)
    if player.dead then return end
    if judge.card.suit == Card.Spade then
      room:addPlayerMark(player, "@sk__chengfeng", 1)
    else
      data.damage = data.damage - 1
    end
  end,
})
sk__chengfeng:addEffect(fk.TurnEnd, {
  name = "sk__chengfeng",
  anim_type = "special",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(sk__chengfeng.name) and player:getMark("@sk__chengfeng") > 1
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:removePlayerMark(player, "@sk__chengfeng", 2)
    player:gainAnExtraTurn(true)
  end,
})

return sk__chengfeng
